﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rongzi.Infrastructure.ServiceBus.Config
{
    public class RabbitMQConfigurationElement: ConfigurationElement
    {
        [ConfigurationProperty("connectionString", IsRequired = false)]
        public string ConnectionString
        {
            get
            {
                return (string)this["connectionString"];
            }
            set
            {
                this["connectionString"] = value;
            }
        }

        [ConfigurationProperty("hostName", IsRequired = true)]
        public string HostName
        {
            get
            {
                return (string)this["hostName"];
            }
            set
            {
                this["hostName"] = value;
            }
        }

        [ConfigurationProperty("port", IsRequired = false)]
        public int? Port
        {
            get
            {
                return (int?)this["port"];
            }
            set
            {
                this["port"] = value;
            }
        }

        [ConfigurationProperty("virtualHost", IsRequired = true)]
        public string VirtualHost
        {
            get
            {
                return (string)this["virtualHost"];
            }
            set
            {
                this["virtualHost"] = value;
            }
        }

        [ConfigurationProperty("userName", IsRequired = true)]
        public string UserName
        {
            get
            {
                return (string)this["userName"];
            }
            set
            {
                this["userName"] = value;
            }
        }

        [ConfigurationProperty("password", IsRequired = true)]
        public string Password
        {
            get
            {
                return (string)this["password"];
            }
            set
            {
                this["password"] = value;
            }
        }

        [ConfigurationProperty("enable", IsRequired = true)]
        public bool Enable
        {
            get
            {
                return (bool)this["enable"];
            }
            set
            {
                this["enable"] = value;
            }
        }
    }
}
